Tables [dbo].[Note]
Properties
PropertyValue
Created10:31:29 AM Tuesday, March 02, 2010
Last Modified1:20:15 PM Thursday, February 23, 2012
Columns
NameData TypeMax Length (Bytes)Allow NullsDefault
Cluster Primary Key PK_Note: NoteKeyForeign Keys FK_Note_UniformRegistry: [dbo].[UniformRegistry].NoteKeyNoteKeyuniqueidentifier16
No
NoteTextntextmax
No
Foreign Keys FK_Note_NotePurposeRef: [dbo].[NotePurposeRef].NotePurposeKeyIndexes IX_Note_NotePurposeKey: NotePurposeKeyNotePurposeKeyuniqueidentifier16
No
CreatedOndatetime8
No
(getdate())
Foreign Keys FK_Note_UserMain_CreatedBy: [dbo].[UserMain].CreatedByUserKeyIndexes IX_Note_CreatedByUserKey: CreatedByUserKeyCreatedByUserKeyuniqueidentifier16
No
UpdatedOndatetime8
No
(getdate())
Foreign Keys FK_Note_UserMain_UpdatedBy: [dbo].[UserMain].UpdatedByUserKeyIndexes IX_Note_UpdatedByUserKey: UpdatedByUserKeyUpdatedByUserKeyuniqueidentifier16
No
Foreign Keys FK_Note_UniformRegistry_NoteFor: [dbo].[UniformRegistry].NoteForUniformKeyIndexes IX_Note_NoteForUniformKey: NoteForUniformKeyNoteForUniformKeyuniqueidentifier16
No
Foreign Keys FK_Note_AccessMain: [dbo].[AccessMain].AccessKeyIndexes IX_Note_AccessKey: AccessKeyAccessKeyuniqueidentifier16
No
MarkedForDeleteOndatetime8
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_Note: NoteKeyPK_NoteNoteKey
Yes
IX_Note_AccessKeyAccessKey
IX_Note_CreatedByUserKeyCreatedByUserKey
IX_Note_NoteForUniformKeyNoteForUniformKey
IX_Note_NotePurposeKeyNotePurposeKey
IX_Note_UpdatedByUserKeyUpdatedByUserKey
Foreign Keys Foreign Keys
NameColumns
FK_Note_AccessMainAccessKey->[dbo].[AccessMain].[AccessKey]
FK_Note_NotePurposeRefNotePurposeKey->[dbo].[NotePurposeRef].[NotePurposeKey]
FK_Note_UniformRegistryNoteKey->[dbo].[UniformRegistry].[UniformKey]
FK_Note_UniformRegistry_NoteForNoteForUniformKey->[dbo].[UniformRegistry].[UniformKey]
FK_Note_UserMain_CreatedByCreatedByUserKey->[dbo].[UserMain].[UserKey]
FK_Note_UserMain_UpdatedByUpdatedByUserKey->[dbo].[UserMain].[UserKey]
SQL Script
CREATE TABLE [dbo].[Note]
(
[NoteKey] [uniqueidentifier] NOT NULL,
[NoteText] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[NotePurposeKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL CONSTRAINT [DF_Note_CreatedOn] DEFAULT (getdate()),
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL CONSTRAINT [DF_Note_UpdatedOn] DEFAULT (getdate()),
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[NoteForUniformKey] [uniqueidentifier] NOT NULL,
[AccessKey] [uniqueidentifier] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
ALTER TABLE [dbo].[Note] ADD CONSTRAINT [PK_Note] PRIMARY KEY CLUSTERED ([NoteKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Note_AccessKey] ON [dbo].[Note] ([AccessKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Note_CreatedByUserKey] ON [dbo].[Note] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Note_NoteForUniformKey] ON [dbo].[Note] ([NoteForUniformKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Note_NotePurposeKey] ON [dbo].[Note] ([NotePurposeKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Note_UpdatedByUserKey] ON [dbo].[Note] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Note] ADD CONSTRAINT [FK_Note_AccessMain] FOREIGN KEY ([AccessKey]) REFERENCES [dbo].[AccessMain] ([AccessKey])
GO
ALTER TABLE [dbo].[Note] ADD CONSTRAINT [FK_Note_NotePurposeRef] FOREIGN KEY ([NotePurposeKey]) REFERENCES [dbo].[NotePurposeRef] ([NotePurposeKey])
GO
ALTER TABLE [dbo].[Note] ADD CONSTRAINT [FK_Note_UniformRegistry] FOREIGN KEY ([NoteKey]) REFERENCES [dbo].[UniformRegistry] ([UniformKey])
GO
ALTER TABLE [dbo].[Note] ADD CONSTRAINT [FK_Note_UniformRegistry_NoteFor] FOREIGN KEY ([NoteForUniformKey]) REFERENCES [dbo].[UniformRegistry] ([UniformKey])
GO
ALTER TABLE [dbo].[Note] ADD CONSTRAINT [FK_Note_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[Note] ADD CONSTRAINT [FK_Note_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
Uses